# 限流器
# 2025/5/7
from collections import Counter


def count(n: int, m: int, arr):
    cycles = []  # arr中每个数字所处的时间区间的编号
    max_cycle = 0  # 记录最大的区间编号
    for num in arr:
        cycle = num // n
        cycles.append(cycle)
        max_cycle = max(max_cycle, cycle)

    res = 0
    for i in range(max_cycle + 1):
        res += min(Counter(cycles).get(i, 0), m)  # 查看第i个区间中总共有多少次访问, 并和最大访问次数m比较, 结果取较小值
    return res


if __name__ == '__main__':
    n, m, l = map(int, input().split())
    ts = list(map(int, input().split()))
    print(count(n, m, ts))
